<template>
	<view class="Feedback">
		<textarea v-model="feed" placeholder="请输入您对我们的意见或建议" />
		<view class="button">
			<button type="warn" @click="addmanagement">保存</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				feed:'',
				access_token:''
			};
		},
		methods:{
			addmanagement(){
				if(uni.getStorageSync('access_token')){
				this.access_token=JSON.parse(uni.getStorageSync('access_token'))
				}else{
					uni.showModal({
					    title: '提示',
					    content: '你还未登录，请先登录',
					    success: function (res) {
					        if (res.confirm) {
								uni.navigateTo({
									url:'/pages/login/login'
								})
					        } else if (res.cancel) {
					        }
					    }
					});
				}
				this.$request('/app/user/feedback', 'post', {
					page: this.page,
					access_token:this.access_token,
					contents:this.feed
				}).then(res => {
					uni.showToast({
						title:res.data.message,
						icon:'none',
						duration:2000
					})
				})
			}
		}
	}
</script>

<style lang="less">
	.Feedback{
		height: 100%;
		background-color: #F3F4F5;
		padding-top: 20rpx;
		textarea{
			width: 100%;
			background-color: #fff;
			padding: 30rpx;
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
		}
		.button {
				width: 90%;
				margin: 0 auto;
				padding: 40rpx 0;
				button{
					border-radius: 20px;
					line-height: 80rpx;
				}
			}
	}
</style>
